package top.kaoshanji.p2ch10b;

import java.io.Serializable;

/**
 * 代码清单-p2ch10b-329页a：序列化时进行对象替换的示例
 * author kaoshanji
 * ^_^
 * create time 2025/2/3 11:33
 */
public class Order implements Serializable {

    private User user;
    private String id;

    public Order(String id, User user) {
        this.user = user;
        this.id = id;
    }

    public String getId() {
        return this.id;
    }

    private Object writeReplace() {
        return new OrderTO(this);
    }
}
